#ifndef WIDGET_H
#define WIDGET_H

#include <QMetaEnum>
#include <QWidget>
#include <list>
#include "workthread.h"
#include <QScopedPointer>
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

/**
 * @brief 用QTcpServer和QTcpSocket，实现tcp通信服务端
 */
class Widget : public QWidget {
  Q_OBJECT

public:
  Widget(QWidget *parent = nullptr);
  ~Widget();

public slots:
  void on_btnStart_clicked();
  void on_btnSend_clicked();
  void showMessage(const QString &info);

private:
  Ui::Widget *ui;
  QScopedPointer<WorkThread>m_workThread;
  bool m_start = false;
};
#endif // WIDGET_H
